<%@ page language="java" import="java.util.*,com.ncp.model.biz.product.*,com.ncp.model.dao.*,com.ncp.model.entity.product.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
ArrayList img = (ArrayList)request.getAttribute("img");
int PageSize = 10;
int showPages=4;
int size=2;
int id=1;
int PageNow = Integer.parseInt((String)request.getAttribute("PageNow"));
int PageCount = Integer.parseInt((String)request.getAttribute("PageCount"));
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'imgAdd.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
   <table width="60%" border="1" align="center">
  <tr>
    <td width="20%">产品ID</td>
    <td width="20%">产品名称</td>
    <td width="23%" colspan="2">操作</td>
   
  </tr>
  <%


for(int i=0;i<img.size();i++){
	
	ImgsUploadBean pbb = (ImgsUploadBean)img.get(i);


%> 

  <tr>
    <td width="20%"><%=pbb.getProductID() %></td>
    <td width="20%"><%=pbb.getProductName() %></td>
    <td>&nbsp;&nbsp;<a href="uploadServletTurn?ProductID=<%=pbb.getProductID()%>">上传图片</a></td>
  </tr>
    <%
  
  }%>
  <tr>
    <td height="17" colspan="5">
    <%
    if(PageNow>1){
    %>
    <a  href="UploadProductImgsServlet?PageNow=<%=PageNow-1%>" class="page" >上一页</a>
<%
    }
   
    	for(int i=PageNow;i<PageNow+5&&i<PageCount;i++){
    	%>
    
    	 <a  href="UploadProductImgsServlet?PageNow=<%=i%>" class="page" >【<%=i%>】</a>
    	<%
    }
    	 if(PageNow<PageCount){
    		    %>
    		    
    		     <a  href="UploadProductImgsServlet?PageNow=<%=PageNow+1%>" class="page" >下一页</a>
    		    <%
    		    }
%>
		</td>
  </tr>
</table>
   
  </body>
</html>
